<!--
 * @Author: zdh
 * @Date: 2025-01-02 22:08:09
 * @LastEditTime: 2025-01-02 23:43:57
 * @Description:  
-->
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app" style="color: red; font-size: 20px;">
    hello {{ msg }} <h4>11</h4>
  </div>
  <script src="dist/vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        msg: 'bb',
        a: {
          value: 1
        },
        list: [1, 2, 3]
      },
      created() {
        console.log('666')
      }
    })

    setTimeout(() => {
      vm.msg = 'cc'
      // vm._updata(vm._render())
    }, 1000)
    // vue初次渲染 => 先初始化数据 => 将模版进行编译 => 变成render() => 生成虚拟节点 => 变成真实DOM => 放到页面上
    // vue 模版编译 template render el 注意：el(必须要有)
    console.log(vm)
    // 1 数据变化，自动更新视图
    // 2 vue中更新组件策略：以组件为单位，给每个组件添加一个watcher，属性变化后，调用这个watcher
  </script>
</body>
</html>